home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 June / SGI Freeware 1998 June.iso / dist / fw_UMINNgopher.idb / usr / freeware / src / gopher_1.12 / gopherd / gopherdconf.h.z / gopherdconf.h
C/C++ Source or Header  |  1997-09-09  |  4KB  |  116 lines

  1. /********************************************************************
  2.  * $Author: drich $
  3.  * $Revision: 1.1 $
  4.  * $Date: 1995/10/03 04:08:35 $
  5.  * $Source: /proj/freeware1.0/gopher1.12/src/gopherd/RCS/gopherdconf.h,v $
  6.  * $Status: $
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: gopherdconf.h
  14.  * Header file for routines in gopherdconf.c
  15.  *********************************************************************
  16.  * Revision History:
  17.  * $Log: gopherdconf.h,v $
  18.  * Revision 1.1  1995/10/03  04:08:35  drich
  19.  * gopher 1.2 check-in
  20.  *
  21.  * Revision 1.1  1992/12/10  23:13:27  lindner
  22.  * gopher 1.1 release
  23.  *
  24.  *
  25.  *********************************************************************/
  26.  
  27.  
  28.  
  29. #ifndef GOPHERDCONF_H
  30. #define GOPHERDCONF_H
  31.  
  32. #include "boolean.h"
  33. #include "STRstring.h"
  34. #include "ext.h"       /** Filename extensions **/
  35. #include "site.h"      /** Hostname/IP security **/
  36.  
  37.  
  38. /**************************************************************************
  39.  * A structure that defines all the changable parameters of a gopher server
  40.  * Read from the file gopherd.conf
  41.  */
  42.  
  43. struct gdconf_struct {
  44.      ExtArray     *Extensions;
  45.      SiteArray    *Sites;
  46.      Accesslevel  Defaccess;       /*** Default access level for unknowns **/
  47.  
  48.      boolean      RunFromInetd;    /*** -I option **/
  49.      boolean      Caching;         /*** -C option **/
  50.      String       *Logfile;        /*** The filename for the logfile **/
  51.      String       *BummerMsg;      /*** Message given to non-secure sites **/
  52.      String       *Data_Dir;       /*** Where our data directory is **/
  53.      String       *Hostname;       /*** A FQDN for the host **/
  54.      int          Port;            /*** The Port we're running at **/
  55.      boolean      chroot;          /*** Are we chroot()ing? **/
  56.  
  57.      boolean      Securityon;      /*** Are we restricting access or not? **/
  58.  
  59.      String       *Admin;          /*** Administrator info **/
  60.      String       *AdminEmail;     /*** E-mail address of administrator **/
  61.      
  62.      String       *Site;           /*** Description of site **/
  63.      String       *Org;            /*** Name of Organization **/
  64.      String       *Loc;            /*** Location of site **/
  65.      String       *Geog;           /*** Latitude and Longitude **/
  66.      int          TZ;              /*** Timezone **/
  67. };
  68.  
  69. typedef struct gdconf_struct GDCobj;
  70.  
  71. #define GDCgetDefAccess(a)      ((a)->Defaccess)
  72. #define GDCgetInetdActive(a)    ((a)->RunFromInetd)
  73. #define GDCsetInetdActive(a,b)  ((a)->RunFromInetd=(b))
  74. #define GDCgetCaching(a)        ((a)->Caching)
  75.  
  76. #define GDCgetLogfile(a)        STRget((a)->Logfile)
  77. #define GDCsetLogfile(a,b)      STRset((a)->Logfile,(b))
  78. #define GDCgetDatadir(a)        STRget((a)->Data_Dir)
  79. #define GDCgetHostname(a)       STRget((a)->Hostname)
  80. #define GDCsetHostname(a,b)     STRset((a)->Hostname,(b))
  81. #define GDCgetPort(a)           ((a)->Port)
  82. #define GDCgetchroot(a)         ((a)->chroot)
  83. #define GDCgetBummerMsg(a)      STRget((a)->BummerMsg)
  84. #define GDCsetBummerMsg(a,b)    STRset((a)->BummerMsg,(b))
  85.  
  86. #define GDCgetAdmin(a)       STRget((a)->Admin)
  87. #define GDCsetAdmin(a,b)     STRset((a)->Admin,(b))
  88. #define GDCgetAdminEmail(a)  STRget((a)->AdminEmail)
  89. #define GDCsetAdminEmail(a,b) STRset((a)->AdminEmail,(b))
  90. #define GDCgetSite(a)        STRget((a)->Site)
  91. #define GDCsetSite(a,b)      STRset((a)->Site,(b))
  92. #define GDCgetOrg(a)         STRget((a)->Org)
  93. #define GDCsetOrg(a,b)       STRset((a)->Org,(b))
  94. #define GDCgetLoc(a)         STRget((a)->Loc)
  95. #define GDCsetLoc(a,b)       STRset((a)->Loc,(b))
  96. #define GDCgetTZ(a)          (a)->TZ
  97.  
  98. /*
  99.  * Real live functions in gopherdconf.c
  100.  */
  101.  
  102. GDCobj       *GDCnew();
  103. void         GDCinit(/* gdc, FILE* gdc.conf file */);
  104. void         GDCdestroy(/* gdc */);
  105.  
  106. boolean      GDCignore(/* gdc, char *filename */);
  107.  
  108. boolean      GDCCanRead(/* gdc, hostname, ipnum */);
  109. boolean      GDCCanBrowse(/* gdc, hostname, ipnum */);
  110. boolean      GDCCanSearch(/* gdc, hostname, ipnum */);
  111.  
  112. boolean      GDCExtension(/*gdc, ext, Gtype, Prefix*/);
  113.  
  114.  
  115. #endif /* GOPHERDCONF_H */
  116.